-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manual_async_fn: take input lifetimes into account #5859
Conversation
The anonymous future returned from an `async fn` captures all input lifetimes. This was not being taken into account. See https://github.com/rust-lang/rfcs/blob/master/text/2394-async_await.md#lifetime-capture-in-the-anonymous-future
(rust_highfive has picked a reviewer for you, use r? to override) |
I just realized I'm missing a test in the issue mod to check that with the bounds added we don't trigger the compile error. I'll add it ASAP. |
Nevermind, the case I was mentioning in my previous comment should trigger a compilation error, we just have to test that we avoid the false positive (to avoid the error), which is already done. PR should be ready to be reviewed, sorry for the confusion. |
Hijacking this PR to reopen the queue @bors treeclosed- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks ok to me, however async is a chapter I have not yet dipped my toes into
r? @yaahc |
@matthiaskrgr lgtm @bors r+ |
📌 Commit e336fe8 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
The anonymous future returned from an
async fn
captures all inputlifetimes. This was not being taken into account.
See https://github.com/rust-lang/rfcs/blob/master/text/2394-async_await.md#lifetime-capture-in-the-anonymous-future
changelog: Take input lifetimes into account in [
manual_async_fn
].Fixes #5765